'use strict';

/**
 * @ngdoc directive
 * @name jgappApp.directive:headermenu
 * @description
 * # headermenu
 */
angular.module('jgappApp')
    .directive('headerMenu', ['$location', function($location) {
        return {
            scope: {},
            template: '<div class="top-menu flex tc fs12">' +
                ' <div class="top-menu-item aboutme active" ng-click="goAboutME()">待我审批</div>' +
                '<div class="top-menu-item newflow active" ng-click="goMytask()">我发起的 ' +
                '<div class = "msg te" ng-show="msg"> {{msg}}</div>' +
                ' </div>' +
                // '<div class="top-menu-item newtask">新建任务</div>' +
                '</div>',
            restrict: 'AE',
            replace: true,
            link: function postLink(scope, element, attrs) {
                // // console.log(attrs.active)
                // var active = attrs.active || "newflow"
                // var className = "." + active;
                // element[0].querySelector(className).classList.add("active");
                scope.goMytask = function() {
                    $location.path("/user/index")
                };
                scope.goAboutME = function() {
                    $location.path("aboutme/index")
                };
            }
        };
    }]);
